<?php

/**
 * Description of MessageManager
 *
 * @author Andre Biel, Timo Prüße
 */
class MessageManager {

    private static $FFontFamily = 'Tahoma';
    private static $FFontSize = '0.8em';
    private static $FImageUrl = '';
    private static $FBorderColor = '#FF8000';
    private static $FBackgroundColor = '#EFF5FB';
    private static $FWidth = '400px';
    private static $FSiteUrl = 'http://localhost/tabp/';

    public static function writeMessage($AMessage, $AMessageType = 0) {
        switch($AMessageType) {
            // Info
            case 0: self::$FImageUrl = self::$FSiteUrl.'/gfx/system/information_32_32.png';
                break;
            // Warning
            case 1: self::$FImageUrl = self::$FSiteUrl.'/gfx/system/warning_32_32.png';
                break;
            // Error
            case 2: self::$FImageUrl = self::$FSiteUrl.'/gfx/system/cancel_32_32.png';
                break;
            // Default --> Info
            default: self::$FImageUrl = self::$FSiteUrl.'/gfx/system/information_32_32.png';
                break;
        }
        $HtmlString = '';
        $HtmlString .= '<div style=\'border: 1px solid ' . self::$FBorderColor . ';
            background-color: '.self::$FBackgroundColor.';
            width: '.self::$FWidth.';padding: 10px 10px 10px 10px;margin-top: 20px; margin-bottom: 20px;\'>
            <table cellpadding=\'0\' cellspacing=\'0\'>
                <tr>
                    <td><img src=\'' . self::$FImageUrl . '\' align=\'left\' /></td>
                    <td><font style=\'font-family: '.self::$FFontFamily.'; font-size: '.self::$FFontSize.';\'>' . $AMessage . '</font></td>
                </tr>
            </table>
            </div>';
        echo $HtmlString;
    }

}

?>
